﻿namespace Grow.Module
{
    /// <summary>
    /// 模块
    /// </summary>
    public interface IModule
    {
        /// <summary>
        /// 模块级别。级别越小越先启动
        /// </summary>
        ModuleLevel Level { get; }
        /// <summary>
        /// 模块启动顺序。模块启动的顺序先按级别启动，同一级别内部再按此顺序启动，
        /// 级别默认为0，表示无依赖，需要在同级别有依赖顺序的时候，再重写为>0的顺序值
        /// </summary>
        int Order { get; }
        /// <summary>
        /// 添加依赖模块
        /// </summary>
        /// <param name="dependModuleBuilder"></param>
        void AddDependModule(IDependModuleBuilder dependModuleBuilder);
        /// <summary>
        /// 添加服务
        /// </summary>
        /// <param name="serviceContainer"></param>
        void AddService(IServiceContainer serviceContainer);
        /// <summary>
        /// 启动服务
        /// </summary>
        /// <param name="serviceContext"></param>
        void UseService(IServiceContext serviceContext);

    }
}